

package com.zg.sso.util;

import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
import cn.hutool.crypto.symmetric.SymmetricCrypto;

public class DESUtil {

    public static String hutoolEncrypt(String str, String key) {
        SymmetricCrypto des = new SymmetricCrypto(SymmetricAlgorithm.DES, key.getBytes());
        return des.encryptHex(str);
    }

    public static String hutoolDecrypt(String str, String key) {
        SymmetricCrypto des = new SymmetricCrypto(SymmetricAlgorithm.DES, key.getBytes());

        return des.decryptStr(str);
    }

}
